package com.zkw.ss.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * Created by Administrator on 2016/5/3 0003.
 */
@WebServlet(name = "param",urlPatterns = {"/param"})
public class ParamServlet extends HttpServlet{
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.getParameterMap();
        String p1=req.getParameter("p1");
        System.out.println(p1);
        PrintWriter out=resp.getWriter();
        out.println("<html>");
        out.println("<head>");
        out.println("<title>MyFirstServlet</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h2>Servlet MyFirstServlet at Servlet2 " + p1 + "</h2>");
        out.println("</body>");
        out.println("</html>");
        out.close();
    }
}
